<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>

<body>
    <div id="app">
        <div v-html="html"></div>
        <!-- <img v-for="item in list" :src="item.image_src" alt=""> -->
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.js"></script>
    <!-- axios ==>  基于promise的形式对ajax进行了封装 -->
    <script>
        // GET 无参数
        // axios.get("https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata").then((res) => {
        //     console.log(res)
        // })
        // GET 有参数  ==> { params: {} }

        // POST 无参数
        // axios.post("https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata").then((res) => {
        //     console.log(res)
        // })

        // POST 有参数
        // axios.post("https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata", {
        //     id: 100
        // }).then((res) => {
        //     console.log(res)
        // })

        const app = new Vue({
            el: "#app",
            created() {
                // axios.get("https://api-hmugo-web.itheima.net/api/public/v1/goods/detail", {
                //     params: {
                //         goods_id: 8888
                //     }
                // }).then(res => {
                //     this.html = res.data.message.goods_introduce
                //     console.log(res.data.message.goods_introduce)
                // })
                // axios.get("https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata").then(res => {
                //     console.log(res)
                //     // try {

                //     // }catch{

                //     // }
                //     if (res.status === 200) {
                //         this.list = res.data.message
                //     }
                // })
            },
            data: {
                list: [],
                html: ""
            }
        })
    </script>
</body>

</html>